package com.hhd.form.controller;

import com.hhd.base.vo.Result;
import com.hhd.form.manager.FormManager;
import com.hhd.form.vo.FormDefinition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/form")
public class DesignFormController {
    @Autowired
    FormManager formManager;

    @PostMapping("/save")
    public Result save(@RequestBody FormDefinition fomDefinition) {
        formManager.saveFormDefinition(fomDefinition);
        return Result.ok();
    }

    @GetMapping("/queryById")
    public Result queryById(String id) {
        return Result.ok(formManager.queryById(id));
    }
}
